#include "includes.h"

#ifdef USE_MISC

bit SleepFlag;
bit SleepDlyFlag;


void Sleep(void)
{
	if(SleepDlyFlag)
	{
		SleepDlyFlag = 0;
		SleepDly();
	}
	SleepFlag = 1;
	while(SleepFlag)
	{
		TA = 0xAA;
		TA = 0x55;
		PCON = 0x06;
		_nop_();
		_nop_();
		_nop_();
	}
}

void SleepDly(void)
{
	uint8_t i;
	for(i=0; i<80; i++);
}


#endif	//USE_MISC
